package com.service;

import com.dao.AdminDao;
import com.entity.Admin;
import com.util.SafeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liuronghua
 * @version 1.0
 * @data 2020-09-2020/9/22 9:07
 * @desc
 */
@Service
public class AdminService {

    @Autowired
    private AdminDao adminDao;

    public Admin getByUsernameAndPassword(String username, String password) {
        return adminDao.selectByUsernameAndPassword(username, SafeUtil.encode(password));
    }

    public List<Admin> getList(){
        return adminDao.selectList();
    }

}
